introduce VM_EVENT_FLAG_SET_REGISTERS
authorRazvan Cojocaru <rcojocaru@bitdefender.com>
Wed, 30 Sep 2015 12:46:32 +0000 (14:46 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 30 Sep 2015 12:46:32 +0000 (14:46 +0200)
commit975efd3baa8dc5a0af8a9f3af6b95566339ae0b2
treeb9e9f5f95b15ee97d0e1dff511ac5c7b768aeeef
parentdc6c3773b23c8ab974ed0a166735be0b2868be18
introduce VM_EVENT_FLAG_SET_REGISTERS

A previous version of this patch dealing with support for skipping
the current instruction when a vm_event response requested it
computed the instruction length in the hypervisor, adding non-trivial
code dependencies. This patch allows a userspace vm_event client to
simply request that the guest's EIP is set to an arbitary value,
computed by the introspection application. The registers that can
now be set are EAX-EDX, ESP, EBP, ESI, EDI, R8-R15, EFLAGS, and EIP.
CR0, CR3 and CR4 are not set, as at the time of vm_event_resume()
we can't call hvm_set_cr{0,3,4}() and simply setting
v->arch.hvm_vcpu.guest_cr[{0,3,4}] is unlikely to have the desired
effect. The rest of the vm_event registers are not set because
they're not being filled by hvm_event_fill_regs(), but only by
p2m_vm_event_fill_regs(). Currently x86-only.
The VCPU needs to be paused for this flag to take effect.

Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
xen/arch/x86/vm_event.c
xen/common/vm_event.c
xen/include/asm-arm/vm_event.h
xen/include/asm-x86/vm_event.h
xen/include/public/vm_event.h